﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace UCSD_BioLit
{
    /// <summary>
    /// Class that stores a list of property values for a saved control.
    /// </summary>
    [DataContract]
    public class ControlProperties
    {
        /// <summary>
        /// control's namespace.
        /// </summary>
        private string strNamespace;

        /// <summary>
        /// the attributes collection.
        /// </summary>
        private Dictionary<string, string> list;

        /// <summary>
        /// control tag id.
        /// </summary>
        private string customXMLid;

        /// <summary>
        /// Initializes a new instance of the ControlProperties class- default one used for de-serialization.
        /// </summary>
        public ControlProperties()
        {
        }

        /// <summary>
        /// Initializes a new instance of the ControlProperties class.
        /// </summary>
        /// <param name="strnamespace">control namespace</param>
        /// <param name="customXMLID">control tag id</param>
        /// <param name="properties">control attributes</param>
        public ControlProperties(string strnamespace, string customXMLID, Dictionary<string, string> properties)
        {
            this.ControlNamespace = strnamespace;
            this.CustomXMLId = customXMLID;
            this.list = new Dictionary<string, string>();
            this.list = properties;
        }
    
        /// <summary>
        /// Gets or sets the custom xml id.
        /// </summary>
        [DataMember]
        public string CustomXMLId
        {
            get { return this.customXMLid; }
            set { this.customXMLid = value; }
        }

        /// <summary>
        /// Gets or sets the Control's namespace.
        /// </summary>
        [DataMember]
        public string ControlNamespace
        {
            get { return this.strNamespace; }
            set { this.strNamespace = value; }
        }

        /// <summary>
        /// Gets or sets the control's property list.
        /// </summary>
        [DataMember]
        public Dictionary<string, string> PropertyList
        {
            get { return this.list; }
            set { this.list = value; }
        }        
     }
}
